import re

target_str = 'There are 6 classer in the computer science major, with 30 students in each class. 1 23 456 789 98989'

patterns = [
    '\d', '\d+', '\d{1,2}', '\d{2,3}?', '\d{2,4}', '\d{2,4}?', '.*', '.*?', '.+?'
]


for pattern in patterns:
    results = re.findall(pattern, target_str)
    print(pattern, ':', results)